<template>
  <div class="side-panel-container">
    <div class="logo-icon-box">
      <img src="../assets/logo.png" alt="hap-studio">
    </div>
    <div class="side-panel-tree-hidden">
      <div class="side-panel-tree-box" @contextmenu="onContextMenu">
        <file-tree-node v-for="node in catelog.children" :key="node.name" :children="node.children" :node="node" :depth="0"></file-tree-node>
      </div>
    </div>
  </div>
</template>
<script>
import { mapGetters } from 'vuex'
import fileTreeNode from './FileTreeNode'

export default {
  components: {
    fileTreeNode
  },
  computed: {
    ...mapGetters(['catelog'])
  },
  methods: {
    onContextMenu (event) {
      event.preventDefault()
      event.stopPropagation()
    }
  }
}
</script>
<style scoped lang="less">
  .side-panel-container {
    color: #FFF;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    background: #222;
    width: 300px;
  }
  .logo-icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
    img {
      width: 200px;
    }
  }
  .side-panel-tree-hidden {
    position: absolute;
    top: 100px;
    bottom: 0;
    width: 100%;
    background: #222;
  }
  .side-panel-tree-box {
    overflow-x: auto;
    overflow-y: auto;
    height: 100%;
  }
</style>
